home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / utils1 / 2m13.arj / 2M-TECH.DOC < prev    next >
Text File  |  1994-02-02  |  7KB  |  135 lines

  1.  
  2.                     TECHNICAL INFORMATION FOR PROGRAMERS
  3.                     ------------------------------------
  4.  
  5.       Perhaps you need know how to format 2M diskettes from your high-level
  6. applications.  2M access always directly to NEC765 diskette controller chip
  7. and 8237 DMA controller. But you have'nt to do the same!!.
  8.  
  9.       When 2M is installed on memory,  INT 13h  service 5 becomes increased
  10. its functionality. To find 2M resident on memory:
  11.  
  12.          Load AL with 0.
  13.          Load ES:DI with 1492h:1992h.
  14.          Load AH with a value from 0C0h to 0FFh.
  15.          Call INT 2Fh.
  16.  
  17.       When INT 2Fh returns, if AL=0FFh and ES:DI points a "CiriSOFT:2M:1.3"
  18. null terminated string...  2M is in memory!.   Note that ':' is a delimiter
  19. and not always CiriSOFT will be  the  manufacturer  (I recomend search only
  20. for the ":2M:" string).  You  can  begin scanning with AH=0C0h and,  if not
  21. found 2M there, continue with AH=0C1h and so on.
  22.  
  23.       When you had detected 2M on memory,  you can call to INT 13h function
  24. 5 to format a diskette track.  This  is easiest than standard BIOS service:
  25. you don't need to select disk density or media.  Of  course,  standard BIOS
  26. function is still available, but if you can call INT 13h as bellow:
  27.  
  28.          Load AH with 5.
  29.          Load AL with 7Fh.
  30.          Load CH with track number.
  31.          Load DH with head number.
  32.          Load DL with drive number.
  33.          Load SI with 324Dh signature ("2M").
  34.          Load ES:BX pointing to boot sector of future 2M diskette.
  35.  
  36.       Note that in standard BIOS call, AL sets the number of sectors (never
  37. is 7Fh) and SI is not neccesary equal to 324Dh. This lets 2M to detect your
  38. intention. You have not to fill big tables on ES:BX, simply point to a boot
  39. sector  of  future diskette. This boot sector can be obtained from standard
  40. 2M diskette already formatted. New INT 13h format function return the sames
  41. codes in AH than the BIOS standard routines.
  42.  
  43.       You don't need to build your own boot  sectors,  buf if you decide to
  44. modify something, you must know:
  45.  
  46.      - 2M diskettes have always  TWO FAT  copies,  for hardware reasons. Do
  47.        not try to alter this specification (yes, for *hardware* reasons).
  48.      - Modifing system ID probably makes 2M not able to detect the diskette,
  49.        and standard BIOS will report sector-not-found errors.
  50.      - Yoy can modify the jump instruction at the begin  of  boot,  and the
  51.        boot code located after destination of this jump.  But  data located
  52.        from offset 63 to last byte before boot code is covered by checksum,
  53.        and you have to compute it if you modify something (the arithmetic 8
  54.        bits add off all bytes must be zero, use checksum byte to force it).
  55.      - Resuming: you can only modify offsets from 0 to 2, from 11 to 61 (it
  56.        is not recommended) and the boot code.
  57.      - If you try to write a boot sector modifing  system ID,  or  with  an
  58.        incorrect  checksum,  2M  resident  code  will  not really write the
  59.        sector on target disk and you will lose your time and your patience.
  60.        If you uninstall 2M to save a boot with  bad  checksum,  the  sector
  61.        will be saved,  but...  with 2M installed you'll get 'seek error' on
  62.        future access.
  63.  
  64.       Here are the format of 2M diskettes, in order to meet your curiosity;
  65. 2M is not a secret or magic program!.  See source code for more information
  66. (if you don't understand the source code comments,  you  may  come to Spain
  67. next summer :) ).
  68.  
  69.  * BOOT SECTOR OF 2M DISKETTE (COMMON TO ALL FORMATS).
  70.  
  71.           Assembler                        Comment                 Offset
  72.       ---------------------  ----------------------------------  ----------
  73.         JMP   SHORT BootP     ; 2 bytes                                0
  74.         NOP                   ; 1 byte                                 2
  75.         DB    "2M-STV04"      ; system ID                              3
  76.         DW    512             ; bytes per sector                      11
  77.         DB    1               ; sectors per cluster                   13
  78.         DW    1               ; sectors reserved at beginning         14
  79.         DB    2               ; number of FAT copies                  16
  80.         DW    224             ; root directory entries                17
  81.         DW    3772            ; total sectors on disk                 19
  82.         DB    0F0h            ; media descriptor                      21
  83.         DW    11              ; sectors ocupied by each FAT           22
  84.         DW    23              ; sectors per track                     24
  85.         DW    2               ; number of heads                       26
  86.         DD    0               ; special sectors reserved              28
  87.         DD    0               ; number of sectors (32 bit drives)     32
  88.         DB    0               ; physical drive                        36
  89.         DB    0               ; reserved                              37
  90.         DB    29h             ; DOS > 4.0  diskette                   38
  91.         DD    4B368A0Eh       ; serial number (random)                39
  92.         DB    "NO NAME    "   ; disk label                            43
  93.         DB    "FAT12   "      ; FAT type                              54
  94.         DB    0               ; reserved by 2M                        62
  95.         DB    0               ; 2M checksum (if used)                 63
  96.         DB    6               ; 2MF format version                    64
  97.         DB    1               ; 1 if write track after format         65
  98.         DB    0               ; data transfer rate on track 0         66
  99.         DB    0               ; data transfer rate on track<>0        67
  100.         DW    BootP           ; offset to boot program                68
  101.         DW    Infp0           ; T1: information for track 0           70
  102.         DW    InfpX           ; T2: information for track<>0          72
  103.         DW    InfTm           ; T3: tracks sectors size table         74
  104.  
  105.  * NORMAL FORMATS (820/1476/984/1804K). FOR EXAMPLE: 1804K.
  106.  
  107.   Infp0 DB    18, 108         ; number of sectors / GAP 3 for format
  108.         DB    1,2,3,4,5,6,7,8 ; sectors ordered (19..20 does not exist)
  109.         DB    9,10,11,12,13
  110.         DB    14,15,16,17,18
  111.   InfpX DB    11, 40          ; number of sectors / GAP3 for format
  112.         DB    3               ; sector size
  113.         DB    1, 2            ; sector slidding (override by 2MF /X /Y)
  114.   InfTm DB    3,3,3,3,3,3     ; size of sectors 1, 2, 3,...
  115.         DB    3,3,3,3,3
  116.   BootP:...                   ; boot program
  117.  
  118.  *  MAXIMUM CAPACITY FORMATS (902/1558/1066/1886K). FOR EXAMPLE: 1886K.
  119.  
  120.   Infp0 DB    18, 108         ; number of sectors, GAP3 for format
  121.         DB    1,2,3,4,5,6,7,8 ; sectors ordered (19..23 does not exist)
  122.         DB    9,10,11,12,13
  123.         DB    14,15,16,17,18
  124.   InfpX DB    64, 3           ; number of sectors / GAP3 for preformat
  125.         DB    7               ; number of sectors to renum
  126.         DB    128+1,  4, 4    ; renum table:
  127.         DB    128+12, 1, 4    ; number of sector, new number, size
  128.         DB    128+23, 5, 4
  129.         DB    128+34, 2, 4
  130.         DB    128+45, 6, 3
  131.         DB    128+51, 3, 4
  132.         DB    128+62, 7, 2
  133.   InfTm DB    4,4,4,4,4,3,2   ; size of sectors 1, 2, 3,...
  134.   BootP:...                   ; boot program
  135.